package com.wgchao.pharmacymg.Infrastructure.menus;

/**
 * @作者：wgchao
 * @时间：19:27 2019/11/19 0019
 * @用途：药库分类
 **/
public enum DslMenu {
    FREEZER("冷库", 1L), SHADE("阴凉库", 2L), NORMAL("常温库", 3L);
    // 成员变量
    private String name;
    private long index;

    // 构造方法
    private DslMenu(String name, long index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(long index) {
        for (DslMenu c : DslMenu.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getIndex() {
        return index;
    }

    public void setIndex(long index) {
        this.index = index;
    }
}
